SET.FETCH_FIRST Function

Syntax

Found_Flag as L = Fetch_First([fetch level])

Arguments

level

Optional. Used when fetching through the records of a set. The outline level determines the depth of the fetch, so that tables at lower levels in the set can be excluded from the Fetch operation.

Description

Fetch the first record in the table/set. returns TRUE if record found.

Discussion

The .FETCH_FIRST() method retrieves the first record in the set referenced by . The first record is determined by the active range, index, or query list. If there are no records in the current range or query, and therefore, no first record is found, a non-zero numeric value is returned. You use the optional Outline_Level_Number parameter when fetching through the records of a set. The outline level determines the depth of the fetch, so that tables at lower levels in the set can be excluded from the Fetch operation. This is useful for operations that relate to only parent records in a set. For more information, see Fetching_Only_Parent_Records_With_Fetch_Outlining.

Example

The following example fetches the first record of the set and displays the description field from the primary table.

dim tset as P
dim tbl as P
tset = set.open("inventory")
tset.fetch_first()
tbl = tset.get_primary()
? tbl.description
= "UnoFold Quick Dry Socks"

See Also